package com.kgc.springboot.hangduo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author: ASUS
 * @date: 2020/12/11 17:17
 * @description:
 */
@Configuration
public class LoginHandlerInterceptor implements HandlerInterceptor {
    //@Override
  //  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        HttpSession session = request.getSession();
//        Object user = session.getAttribute("user");
//        if (user==null){
//            request.setAttribute("msg","对不起，请先登录！");
//            request.getRequestDispatcher("/tologin.html").forward(request,response);
//            return false;
//        }else {
//            return true;
//        }

   // }
}
